import numpy as np

#定义苹果类
class appleclass(object):
    def __init__(self, map_size):
        self.map_size = map_size
        self.position = np.random.randint(1, self.map_size,2)
        self.score = 0
    #分数累加，刷新位置
    def eaten(self):
        self.position = np.random.randint(1, self.map_size,2)
        self.score += 1